<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/jquery.mobile-1.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="css/mobiscrollcss/mobiscroll.custom-2.6.2.min.css">
<link rel="stylesheet" type="text/css" href="css/salecss.css">
<script type="text/javascript" src="js/lib/jquery-2.1.1.min.js"></script>
<script src="js/mobiscroll.custom-2.6.2.min.js"></script>
<script type="text/javascript" src="js/JKLogin.js"></script>
<script type="text/javascript" src="js/JKCheckForm.js"></script>
<script type="text/javascript" src="js/JKFunc.js"></script>
<script type="text/javascript" src="js/JKRegister.js"></script>
<script type="text/javascript" src="js/lib/jquery.mobile-1.4.2.min.js"></script>
<script type="text/javascript">
var storage;
var saleAdminId;
var telephone;
var salesmanName;
var bankName;
var  bankCardNo;
var adminArr = new Array();
var lat;//精度
var lng;//纬度
var isOk = false;
var pageId = "51";
window.onload = function(){
storage = window.localStorage;
window.saleAdminId=storage.getItem("saleAdminId");
if(window.saleAdminId==null){
		storage.clear();
		if("undefined" != typeof (mobile)){
			mobile.logout();
		}
		window.location.href="index.html";
	}else{
		window.telephone=storage.getItem("telephone");	
		window.salesmanName=storage.getItem("salesmanName");
		window.bankName=storage.getItem("bankName");
		window.bankCardNo=storage.getItem("bankCardNo");
		findIntentCustomer();
		listAdminBySale();

		if(telephone && telephone != '' && "undefined" != typeof (mobile)){
			mobile.login(telephone);
		}
	}

}

function checkOk(){
	if(window.lat!=null&&window.lng!=null){
	window.isOk = true;
	}
}



function updateShopAddress(){
	window.isOk = false;
	window.lat = null;
	window.lng = null;
	
	
	getMap();
	$("#gm"+window.pageId).popup();
	$("#gm"+window.pageId).popup("open");
	var t1 = window.setInterval("checkOk()",1000); 
	var t2 = window.setInterval(function (){
			 if(isOk){
				 $("#gm"+window.pageId).popup("close");
				 window.clearInterval(t1); 
					window.clearInterval(t2); 
					
	JKjsonP({
			ws:"merchants/updateShopAddress2",
			parameter:{phoneNumber:window.telephone,lat:window.lat,lng:window.lng},
			sFunc:function(json){
				if(json.result == "success"){
					
					alert(json.msg);					
				}
				
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				
			}
		});}
			 },5000);
	
}
function getMap(){
if (navigator.geolocation){
    navigator.geolocation.getCurrentPosition(showPosition);
    }else{
	  alert("您的手机不支持地理定位");
	} 
}
function showPosition(position){
  window.lat = position.coords.latitude; 
  window.lng = position.coords.longitude;
}

function listAdminBySale(){
	$("#intent151 li").remove();
		  $("#intent251 li").remove();
		  $("#intent351 li").remove();
		  $("#intent451 li").remove();
		  $("#intent551 li").remove();
  JKjsonP({
					ws:"merchants/listAdminBySale",
					parameter:{saleId:window.saleAdminId},
					sFunc:function(json){
						if(json.result=="success"){
							window.adminArr = json.data;
							var obj = json.data;
							var len = obj.length;
							for(var i=0;i<len;i++){
								var shopAdminId = obj[i].shopAdminId;
								var address = obj[i].address;
								var shopName = obj[i].shopName;
								var mobilePhone = obj[i].mobilePhone;
								var userType = obj[i].userType;
								$("#intent"+userType+"51").append('<li><a onClick="go52('+shopAdminId+')" data-transition="slide" style="background-color:#fffcdb; color:#e60012"> <div class="ui-grid-b"><div class="ui-block-a"> <span>商家名称：</span> </div><div class="ui-block-b"> <span>'+shopName+'</span> </div><div class="ui-block-c"> </div> </div><div class="ui-grid-b"><div class="ui-block-a"> <span>地址：</span> </div><div class="ui-block-b"> <span>'+address+'</span> </div><div class="ui-block-c"> </div></div><div class="ui-grid-b"><div class="ui-block-a"> <span>手机号：</span> </div><div class="ui-block-b"> <span>'+mobilePhone+'</span> </div><div class="ui-block-c"> </div> </div></a></li>');
								
							}
							$('#page_5_1 ul').listview()
							$('#page_5_1 ul').listview('refresh')
							
							}else{
							alert(json.msg);
							}
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});
}

function findIntentCustomer(){
		 $("#intenttrue51 li").remove();
		  $("#intentfalse51 li").remove();
					JKjsonP({
					ws:"sales/findIntentCustomer",
					parameter:{saleAdminId:window.saleAdminId},
					sFunc:function(json){
						if(json.result=="success"){
							var obj = json.data.intentionCustomerList;
							var len = obj.length;
							for(var i=0;i<len;i++){
								var intentId = obj[i].id;
								var address = obj[i].address;
								var shopName = obj[i].shopName;
								var telephone = obj[i].telephone;
								var intent = obj[i].intent;
								
								$("#intent"+intent+"51").append('<li><a onClick="go54('+intentId+')" data-transition="slide" style="background-color:#fffcdb; color:#e60012"> <div class="ui-grid-b"><div class="ui-block-a"> <span>商家名称：</span> </div><div class="ui-block-b"> <span>'+shopName+'</span> </div><div class="ui-block-c"> </div> </div><div class="ui-grid-b"><div class="ui-block-a"> <span>地址：</span> </div><div class="ui-block-b"> <span>'+address+'</span> </div><div class="ui-block-c"> </div></div><div class="ui-grid-b"><div class="ui-block-a"> <span>手机号：</span> </div><div class="ui-block-b"> <span>'+telephone+'</span> </div><div class="ui-block-c"> </div> </div></a></li>');
								
							}
							$('#page_5_1 ul').listview()
							$('#page_5_1 ul').listview('refresh')
							
							}else{
							alert(json.msg);
							}
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});
}

function toInfo(){
	$("#salemanName61").html(window.salesmanName);
	$("#bankCardNo61").html(window.bankCardNo);
$("#telephone61").html(window.telephone);
$("#bankName61").html(window.bankName);

JKjsonP({
	ws:"customerService/getCurrentMonthById",
	parameter:{id:window.saleAdminId},
	sFunc:function(json){
		if(json.result=="success"){
			localStorage.setItem("mrsr",json.data.today);
			localStorage.setItem("bysr",json.data.currentMonth);
			localStorage.setItem("sysr",json.data.lastMonth);
			window.mrsr=storage.getItem("mrsr");
			window.bysr=storage.getItem("bysr");
			window.sysr=storage.getItem("sysr");
			$('#mrsr61').html(window.mrsr+"元");
			$('#bysr61').html(window.bysr+"元");
			$('#sysr61').html(window.sysr+"元");
		}
	},
	eFunc:function(XMLHttpRequest, textStatus, emessage){
	}
});
}


</script>
</head>

<body>
<div data-role="page" id="page_5_1"  data-theme="jk" >
  <div data-role="header">
  <a  class="ui-btn ui-corner-all " onClick="go53()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">添加意向</a> 
   <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>意向客户管理</h1>
    
   </div>
  <div data-role="content">
    <div data-role="collapsible-set" data-inset="false">
      <div data-role="collapsible">
        <h3 >过3天付费期</h3>
        <ul data-role="listview" id="intent451">
          
        </ul>
      </div>
      <div data-role="collapsible">
        <h3>过试用期</h3>
        <ul data-role="listview" id="intent551">
          
        </ul>
      </div>
      <div data-role="collapsible">
        <h3>预付费</h3>
        <ul data-role="listview" id="intent151">
         
        </ul>
      </div>
      <div data-role="collapsible">
        <h3>试用</h3>
        <ul data-role="listview" id="intent251">
          
        </ul>
      </div>
      <div data-role="collapsible">
        <h3>有意向</h3>
        <ul data-role="listview" id="intenttrue51">
        </ul>
      </div>
      <div data-role="collapsible">
        <h3>无意向</h3>
        <ul data-role="listview" id="intentfalse51">
        </ul>
      </div>
      <div data-role="collapsible">
        <h3>已付费</h3>
        <ul data-role="listview" id="intent351">
          
        </ul>
      </div>
    </div>
  </div>
  <div data-role="popup" id="gm51" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>

<script type="text/javascript">
function go52(id){
	window.pageId = "52";
	window.isShop = false;
	var len = window.adminArr.length;
	for(var i=0;i<len;i++){
		if(id == window.adminArr[i].shopAdminId){
			var address52 = window.adminArr[i].address;
			var shopName52 = window.adminArr[i].shopName;
			var code52 = window.adminArr[i].code;
			var mobilePhone52 =window.adminArr[i].mobilePhone;
			var dateCreated52= window.adminArr[i].dateCreated;
			var userType52 = window.adminArr[i].userType;
			switch(userType52){
			case 1:
			userType52 = "预付费"
			break;
			case 2:
			userType52 = "试用"
			break;
			case 3:
			userType52 = "已付费"
			break;
			case 4:
			userType52 = "过3天付费期"
			break;
			case 5:
			userType52 = "过试用期"
			break;
			}
			$("#address52").html(address52);
			$("#shopName52").html(shopName52);
			$("#code52").html(code52);
			$("#mobilePhone52").html(mobilePhone52);
			$("#userType52").html(userType52);
			$("#dateCreated52").html(dateCreated52);
			$.mobile.changePage("#page_5_2",{transition: "slide"});
		}
	}
}
function go53(){
	window.pageId = "53";
	window.isShop = false;
	 $("#page_5_3").page();
	  $("#true53").attr("checked",false);
	  $("#false53").attr("checked",false);
	  
	$("#true53").attr("checked", "checked");
	$("#true53").prev("label").removeClass("ui-radio-off").addClass("ui-radio-on");
	$("#false53").prev("label").removeClass("ui-radio-on").addClass("ui-radio-off");
	
	$("#shopName53").val("");
	$("#shopAdd53").val("");
	$("#comments53").val("");
	$("#phone53").val("");
	$.mobile.changePage("#page_5_3",{transition: "slide"});
}
function go54(id){
	window.pageId = "54";
	window.isShop = false;
	$("#true54").attr("checked", false);
	$("#false54").attr("checked", false);
	$("#shopName54").html("");
							$("#address54").html("");
							$("#comments54").val("");
							$("#telephone54").html("");
	JKjsonP({
					ws:"sales/findIntentCustomer",
					parameter:{id:id},
					sFunc:function(json){
						if(json.result=="success"){
							var obj = json.data.intentionCustomer;
							var shopName = obj.shopName;
							var address = obj.address;
							var comments = obj.comments;
							var telephone = obj.telephone;
							var intent = obj.intent;
							$("#shopName54").html(shopName);
							$("#address54").html(address);
							$("#comments54").val(comments);
							$("#telephone54").html(telephone);
							if(intent=="true"){
								$("#true54").attr("checked", "checked");
								$("#true54").val("true");
									$("#true54").prev("label").removeClass("ui-radio-off").addClass("ui-radio-on");
	$("#false54").prev("label").removeClass("ui-radio-on").addClass("ui-radio-off");
							}else if(intent=="false"){
								$("#false54").attr("checked", "checked");
								$("#false54").val("false");
	$("#true54").prev("label").removeClass("ui-radio-on").addClass("ui-radio-off");
	$("#false54").prev("label").removeClass("ui-radio-off").addClass("ui-radio-on");
							}
							
							$("#updataCustomer54").attr("onclick","updataCustomer("+id+")");
							$.mobile.changePage("#page_5_4",{transition: "slide"});
							
							}else{
							alert(json.msg);
							
							}
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});
}
</script>
<div data-role="page" id="page_5_2" data-theme="jk">

  <div data-role="header"> 
 
  <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back" style="border:none; color:#FFF">返回</a>
   <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" border:none;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>意向客户管理</h1>
  </div>
  <div data-role="content">
    <div >
      <h4 id="userType52"></h4>
      <div class="ui-grid-b" >
        <div class="ui-block-a"> <span>商家名称：</span> </div>
        <div class="ui-block-b" style="width:auto"> <span id="shopName52"></span> </div>
        <div class="ui-block-c"> </div>
      </div>
      <div class="ui-grid-b">
        <div class="ui-block-a"> <span>地址：</span> </div>
        <div class="ui-block-b" style="width:auto"> <span id="address52"></span> </div>
        <div class="ui-block-c"> </div>
      </div>
      <div class="ui-grid-b">
        <div class="ui-block-a"> <span>手机号：</span> </div>
        <div class="ui-block-b" style="width:auto"> <span id="mobilePhone52"></span> </div>
        <div class="ui-block-c"> </div>
      </div>
    </div>
    <br>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> <span >编号：</span> </div>
      <div class="ui-block-b" style="width:auto"> <span id="code52"></span> </div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b">
      <div class="ui-block-a"> <span>开户时间：</span> </div>
      <div class="ui-block-b" style="width:auto"> <span id="dateCreated52"></span> </div>
      <div class="ui-block-c"> </div>
    </div>
  </div>
  <div data-role="popup" id="gm52" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>

</div>
<div data-role="page" id="page_5_3" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back" style="border:none; color:#FFF">返回</a>
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>意向客户管理</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-a" >
      <div class="ui-block-a" > <span>商家名称：</span> </div>
      <div class="ui-block-b" style="width:100%">
        <input type="text" id="shopName53" style="background-color:#FFFFFF;">
      </div>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a" > <span>地址：</span> </div>
      <div class="ui-block-b" style="width:100%">
        <input type="text" id="shopAdd53" style="background-color:#FFFFFF;">
      </div>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a" > <span>手机号：</span> </div>
      <div class="ui-block-b" style="width:100%">
        <input type="text" id="phone53" style="background-color:#FFFFFF;">
      </div>
    </div>
    <label for="comments53" >备注：</label>
    <textarea id="comments53" style="width:100%"> </textarea>
   <span>购买意向：</span> 
    <fieldset data-role="controlgroup" >
      <div class="ui-grid-a" >
        <div class="ui-block-a" >
          <label for="true53" style="border:none">有</label>
          <input type="radio" name="intent53" id="true53" value="true" checked data-cacheval="true">
        </div>
        <div class="ui-block-b">
          <label for="false53" style="border:none">无</label>
          <input type="radio" name="intent53" id="false53" value="false">
        </div>
      </div>
    </fieldset>
    <p style="text-align:center"><a  class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" style="background-color:#f08200; color:#FFFFFF;" onClick="intentCustomer_Submit()">完成</a> </p>
    
  </div>
  <div data-role="popup" id="gm53" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>

<script type="text/javascript">
function intentCustomer_Submit(){
	var txt ="";
	var shopName53 = $("#shopName53").val();
	var shopAdd53 = $("#shopAdd53").val();
	var telephone53=$("#phone53").val();
	var comments53 = $("#comments53").val();
	var intent53 = $("input[name='intent53']:checked").val();
	if(intent53 == "undefined"){
		intent53 = true;
	}
	if(shopName53==""){
		txt+="商家名称";
	}
	if(shopAdd53==""){
		txt+= " 地址";
	}
	if(txt!=""){
		txt+=" 不能为空";
		alert(txt);
	}else if($("#phone53").val()==""||JKCheckMobile($("#phone53"))){
		JKjsonP({
					ws:"sales/intentCustomer",
					parameter:{saleAdminId:window.saleAdminId, shopName:shopName53,address:shopAdd53,telephone:telephone53,comments:comments53,intent:intent53},
					sFunc:function(json){
						if(json.result=="success"){
							alert(json.msg);
							findIntentCustomer();
							$.mobile.changePage("#page_5_1",{transition: "slide"});
							}else{
							alert(json.msg);
							}
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});
	}
}
</script>
<div data-role="page" id="page_5_4" data-theme="jk">
  <div data-role="header"> <a  class="ui-btn ui-corner-all" data-rel="back" data-icon="back" style="border:none; color:#FFFFFF">返回</a>
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>意向客户管理</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-b" >
      <div class="ui-block-a"> <span>商家名称：</span> </div>
      <div class="ui-block-b" style="width:auto"> <span id="shopName54"></span> </div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b">
      <div class="ui-block-a"> <span>地址：</span> </div>
      <div class="ui-block-b" style="width:auto"> <span id="address54"></span> </div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b">
      <div class="ui-block-a"> <span>手机号：</span> </div>
      <div class="ui-block-b" style="width:auto"> <span id="telephone54">0</span> </div>
      <div class="ui-block-c"> </div>
    </div>
    <label for="comments54">备注：</label>
    <textarea id="comments54" > </textarea>
     <span>购买意向：</span> 
    <fieldset data-role="controlgroup">
      <div class="ui-grid-a">
        <div class="ui-block-a">
          <label for="true54" style=" border:none">有</label>
          <input type="radio" name="intent54" id="true54" value="true" >
        </div>
        <div class="ui-block-b">
          <label for="false54" style="border:none">无</label>
          <input type="radio" name="intent54" id="false54" value="false">
        </div>
      </div>
    </fieldset>
    <p style="text-align:center"><a id="updataCustomer54" class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" style="background-color:#f08200; color:#FFFFFF" >修改</a> </p>
  </div>
  <div data-role="popup" id="gm54" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>

</div>
<script type="text/javascript">
function updataCustomer(id){
	var comments54=$("#comments54").val();
	var intent54 = $("input[name='intent54']:checked").val();
	JKjsonP({
					ws:"sales/intentCustomer",
					parameter:{id:id, saleAdminId:window.saleAdminId,comments:comments54,intent:intent54},
					sFunc:function(json){
						if(json.result=="success"){
							alert(json.msg);
							findIntentCustomer();
							$.mobile.changePage("#page_5_1",{transition: "slide"});
							}else{
							alert(json.msg);
							}
							
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});
}
</script>
<div data-role="page" id="page_6_1" data-theme="jk">
  <div data-role="header">
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>销售个人信息</h1>
  </div>
  <div data-role="content">
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 姓名</div>
      <div class="ui-block-b" id="salemanName61"> 王明</div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 手机号：</div>
      <div class="ui-block-b" id="telephone61"> </div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 登录密码：</div>
      <div class="ui-block-b"> *******</div>
      <div class="ui-block-c" > </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini"  onClick="go62()" >修改密码</a> </div>
      <div class="ui-block-c" > </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 银行卡号：</div>
      <div class="ui-block-b" id="bankCardNo61"> </div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 开户行：</div>
      <div class="ui-block-b" style="width:auto" id="bankName61"> </div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 明日收入：</div>
      <div class="ui-block-b" id="mrsr61"></div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 本月收入：</div>
      <div class="ui-block-b" id="bysr61"></div>
      <div class="ui-block-c"> </div>
    </div>
    <div class="ui-grid-b" >
      <div class="ui-block-a"> 上月收入：</div>
      <div class="ui-block-b" id="sysr61"></div>
      <div class="ui-block-c"> </div>
    </div>
  </div>
  <div data-role="popup" id="gm61" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>
<script type="text/javascript">
function go62(){
window.pageId = "62";
window.isShop = false;
$.mobile.changePage("#page_6_2",{transition: "slide"});
		
}
</script>
<div data-role="page" id="page_6_2" data-theme="jk">
  <div data-role="header">
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>修改登录密码</h1>
  </div>
  <div data-role="content">
    <div class="ui-field-contain">
      <label for="oldpwd62">原密码：</label>
      <input type="password" name="oldpwd62" id="oldpwd62" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="newpwd62">新密码：</label>
      <input type="password" name="newpwd62" id="newpwd62" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="rnewpwd62">确认密码：</label>
      <input type="password" name="rnewpwd62" id="rnewpwd62" style="background-color:#FFFFFF">
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all"   data-transition="slide" onClick="resetPassword62()">提交</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" href="#page_6_1" data-transition="slide">返回</a> </div>
    </div>
  </div>
  <div data-role="popup" id="gm62" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>
<script type="text/javascript">
function resetPassword62(){
	var oldpwd62 = $("#oldpwd62").val();
	var newpwd62 = $("#newpwd62").val();	
	var rnewpwd62 = $("#rnewpwd62").val();
	var txt="";
	if(oldpwd62==""){
	txt+="原密码";
	}
	if(newpwd62==""){
	txt+=" 新密码";
	}
	if(rnewpwd62==""){
	txt+=" 确认密码";
	}
	if(txt!=""){
		txt +=" 未填写";
		alert(txt);
	}else if(JKCheckPasswordSet($("#newpwd62"), $("#rnewpwd62"))){
		JKjsonP({
			ws:"sales/updatePassword",
			parameter:{id:window.saleAdminId, oldPassword:oldpwd62,newPassword:newpwd62},
			sFunc:function(json){
				if(json.result=="success"){
					alert(json.msg);
					$.mobile.changePage("#page_6_1",{transition: "slide"});
				}else{
					alert(json.msg);
				}
			},
			eFunc:function(XMLHttpRequest, textStatus, emessage){
				alert(emessage);
			}
		});	
	}
}
</script>
<div data-role="page" id="page_3_1" data-theme="jk">
  <div data-role="header">
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>付费用户账户申请</h1>
  </div>
  <div data-role="content">
    <div class="ui-field-contain">
      <label for="shopName31">商家名称：</label>
      <input type="text" name="shopName31" id="shopName31" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="cardno31">身份证：</label>
      <input type="text" id="cardno31" value="" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="phone13">手机号：</label>
      <input type="text" name="phone31" id="phone31" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="address31">地址：</label>
      <textarea  name="address31" id="address31" ></textarea>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all"   data-transition="slide" onClick="submit31()">提交</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" href="#page_5_1" data-transition="slide">返回</a> </div>
    </div>
  </div>
  <div data-role="popup" id="gm31" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
 <div data-role="popup" id="gm312" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>

<script type="text/javascript">
     function submit31() {
		var txt = "";
		 if($("#shopName31").val()=="") {
			txt += "商家名称 ";
		 }
		 if($("#cardno31").val()=="") {
			txt += "身份证 "; 
		 }
		  if($("#phone31").val()=="") {
			txt += "手机号 ";
		 }
		if($("#address31").val()=="") {
			txt += "地址 ";
		 }
		 if(txt!="") {
			txt += "不能为空！";
			//$("#afui").popup(txt); 
			alert(txt);
		 }else if(JKCheckCardNo($("#cardno31"))) {
				if(JKCheckMobile($("#phone31"))) {
					var sname = $("#shopName31").val();
					var cardNo = $("#cardno31").val();
					var userName = $("#phone31").val();
					var adress = $("#address31").val();
					var userType = "1";
					if(window.lat!=null&&window.lng!=null){
					JKjsonP({
					ws:"merchants/registerMain",
					parameter:{saleId:window.saleAdminId,username:userName, cardNo:cardNo, userType:userType, shopName:sname,address:adress,lat:window.lat,lng:window.lng},
					
					sFunc:function(json){
							alert(json.msg);
							if(json.result=="success"){
								var password32 = json.data.password;
								var shopNo32 = json.data.shopNo;
								$("#shopNo32").html(shopNo32);
								$("#password32").html(password32);
								listAdminBySale();
								window.pageId = "32";
								$.mobile.changePage("#page_3_2",{transition:"slide"});
								}
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
					
				
				});	
					}else{
					alert("地理位置获取失败，请稍后重新提交");
					}
			}
		}
	 }
	 </script>
<div data-role="page" id="page_3_2" data-theme="jk">
  <div data-role="header">
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>付费用户账户申请</h1>
  </div>
  <div data-role="content">
    <p><span>商家编号：</span><span id="shopNo32"></span></p>
    <p><span>初始密码：</span><span id="password32"></span></p>
    <p align="center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini"  href="#page_5_1" data-transition="slide">确认</a></p>
  </div>
  <div data-role="popup" id="gm32" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>
<div data-role="page" id="page_4_1" data-theme="jk">
  <div data-role="header">
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>试用用户账户申请</h1>
  </div>
  <div data-role="content">
    <div class="ui-field-contain">
      <label for="shopName41">商家名称：</label>
      <input type="text" name="shopName41" id="shopName41" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="cardno41">身份证：</label>
      <input type="text" id="cardno41" name="cardno41" value="" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="phone41">手机号：</label>
      <input type="text" name="phone41" id="phone41" style="background-color:#FFFFFF">
    </div>
    <div class="ui-field-contain">
      <label for="address41">地址：</label>
      <textarea  name="address41" id="address41" ></textarea>
    </div>
    <div class="ui-grid-a">
      <div class="ui-block-a"> <a class="ui-btn ui-corner-all"   data-transition="slide" onClick="submit41()">提交</a> </div>
      <div class="ui-block-b"> <a class="ui-btn ui-corner-all" href="#page_5_1" data-transition="slide">返回</a> </div>
    </div>
  </div>
  <div data-role="popup" id="gm41" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
 <div data-role="popup" id="gm412" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>

<script type="text/javascript">
     function submit41() {
		var txt = "";
		 if($("#shopName41").val()=="") {
			txt += "商家名称 ";
		 }
		 if($("#cardno41").val()=="") {
			txt += "身份证 "; 
		 }
		  if($("#phone41").val()=="") {
			txt += "手机号 ";
		 }
		if($("#address41").val()=="") {
			txt += "地址 ";
		 }
		 if(txt!="") {
			txt += "不能为空！";
			alert(txt);
		 }else if(JKCheckCardNo($("#cardno41"))) {
				if(JKCheckMobile($("#phone41"))) {
			        var sname41 = $("#shopName41").val();
					var cardNo41 = $("#cardno41").val();
					var userName41 = $("#phone41").val();
					var adress41 = $("#address41").val();
					var userType = "2";
					if(window.lat!=null&&window.lng!=null){
		   JKjsonP({
					ws:"merchants/registerMain",
				parameter:{saleId:window.saleAdminId,username:userName41, cardNo:cardNo41, userType:userType, shopName:sname41,address:adress41,lat:window.lat,lng:window.lng},
					sFunc:function(json){
							alert(json.msg);
							
							if(json.msg=="保存成功"){
								var password42 = json.data.password;
								var shopNo42 = json.data.shopNo;
								$("#shopNo42").html(shopNo42);
								$("#password42").html(password42);
								listAdminBySale();
								window.pageId = "42";
								$.mobile.changePage("#page_4_2",{transition:"slide"});
								}
					},
					eFunc:function(XMLHttpRequest, textStatus, emessage){
						alert(emessage);
					}
				});				
			 }else{
			 alert("地理位置获取失败，请稍后重新提交");
			 }
		 }
     }
	 }
	 </script>
<div data-role="page" id="page_4_2" data-theme="jk">
  <div data-role="header">
  <a  class="ui-btn ui-corner-all ui-btn-right"  onClick="panel()" data-transition="slide" style=" background-color:#FF0000;color:#FFFFFF; border-color:#FF0000;">菜单</a>
    <h1>试用用户账户申请</h1>
  </div>
  <div data-role="content">
    <p><span>商家编号：</span><span id="shopNo42"></span></p>
    <p><span>初始密码：</span><span id="password42"></span></p>
    <p align="center"><a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini"  href="#page_5_1" data-transition="slide">确认</a></p>
  </div>
  <div data-role="popup" id="gm42" data-dismissible="false" style="padding:5px" data-theme="b">
<p align="center"><img src="css/images/ajax-loader.gif"/></p>
<p>正在获取地址，请稍候...</p>
</div>
</div>
<div data-role="panel" id="leftpanel" data-position="right" data-display="reveal" data-theme="jk" style="background-color:#fff9b0">
  <ul data-role="listview">
  	<li><a class="ui-btn" onClick="updateShopAddress()">更新测试地址</a></li>
    <li><a href="#page_5_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_5_1');">意向客户管理</a></li>
    <li><a data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_3_1');">付费用户账户申请</a></li>
    <li><a data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_4_1');">试用用户账户申请</a></li>
    <li><a href="#page_6_1" data-transition="slide" class="ui-btn" onClick="javascript:samePageID('#page_6_1');">销售个人信息</a></li>
     <li><a  class="ui-btn"  onClick="logout()">退出</a></li>
  </ul>
</div>
<script>
function panel(){
	if($("#leftpanel").open){
		$( "#leftpanel" ).panel( "close" );
	}else{
	$( "#leftpanel" ).panel( "open" );
	}
}

function reLogin(){
	storage.clear();
	if("undefined" != typeof (mobile)){
		mobile.logout();
	}
	window.location.href="index.html";
}
function logout(){
	storage.clear();
	if("undefined" != typeof (mobile)){
		mobile.logout();
	}
	window.location.href="index.html";
}

	var currentPageID = "#page_5_1";
	$(function() {
		$(document).on("swipeleft", function(event){
			$( "#leftpanel" ).panel( "open" );
		});
		$(document).on("swiperight", function(event){
			$( "#leftpanel" ).panel( "close" );
		});
	});
	function samePageID(newPageID){
		if(newPageID=="#page_5_1"){
		window.pageId = "51";
		}
		if(newPageID=="#page_6_1"){
			window.pageId = "61";
		toInfo();
		}
		if(newPageID=="#page_3_1"){
			window.pageId = "31";
			window.isOk =false;
	window.lat = null;
	window.lng = null;
	
	
	getMap();
	$("#gm312").popup();
	$("#gm312").popup("open");
	var t1 = window.setInterval("checkOk()",1000); 
	var t2 = window.setInterval(function (){
			 if(window.isOk){
				 	window.clearInterval(t1); 
					window.clearInterval(t2); 
					$("#shopName31").val("");
	$("#cardno31").val("");
	$("#phone31").val("");
	$("#address31").val("");
	$.mobile.changePage("#page_3_1",{transition: "slide"});	
			 }
			 },5000);
	
	
		}
		
		if(newPageID=="#page_4_1"){
			window.pageId = "41";
			window.isOk =false;
			window.lat = null;
	window.lng = null;
	
	
	getMap();
	$("#gm412").popup();
	$("#gm412").popup("open");
	var t1 = window.setInterval("checkOk()",1000); 
	var t2 = window.setInterval(function (){
			 if(window.isOk){
				 	window.clearInterval(t1); 
					window.clearInterval(t2); 
	$("#shopName41").val("");
	$("#cardno41").val("");
	$("#phone41").val("");
	$("#address41").val("");
	$.mobile.changePage("#page_4_1",{transition: "slide"});	
			 }
			 },5000);
	
	
		}
		if(currentPageID == newPageID) {
			$(":jqmData(role='panel')").panel('close');
		}else{
			currentPageID = newPageID;
		}
	};
</script> 
<script id="panel-init">
		$(function() {
			$( "body>[data-role='panel']" ).panel();
		});
	</script>
</body>
</html>
